﻿var IpList = function() {
	this.Load();
}

IpList.prototype.Load = function() {
	var self = this;
	$('#reports-ips tbody').empty();
	$.getJSON('/call.aspx?source=server&mode=ips', function(data) {
		for (var i in data) {
			self.AppendRow(data[i]);
		}
	});
}

IpList.prototype.AppendRow = function(item) {
	var title = 'Name: ' + item.name + "<br />Model: " + item.model + "<br />Vendor: " + item.vendor;
	var tr = $('<tr><td>' + item.ip + '</td><td>' + item.cname + '</td><td>' + item.rack + '</td><td>' + item.dc + '</td><td>&nbsp;</td><td>&nbsp;</td></tr>').appendTo('#reports-ips tbody');
	$(tr.children()[1]).tooltip(title);
}